package casanet.ui.android;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
import casanet.activity.Economie;
import casanet.activity.Maroc;
import casanet.activity.Monde;
import casanet.activity.Sport;

public class Menara  extends TabActivity {
	private int indexTab = 0;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		Resources res = getResources(); 
		TabHost tabHost = getTabHost(); 
		TabHost.TabSpec spec; 
		Intent intent; 		
		
		Bundle extras = getIntent().getExtras();
		if (extras != null) {
			this.indexTab = (Integer)extras.get("indexe");
		}
		else this.indexTab = 0;


		intent = new Intent().setClass(this, Maroc.class);
		spec = tabHost.newTabSpec("maroc").setIndicator("Maroc",
				null)
				.setContent(intent);			
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, Monde.class);
		spec = tabHost.newTabSpec("monde").setIndicator("Monde",
				null)
				.setContent(intent);				
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, Economie.class);
		spec = tabHost.newTabSpec("economie").setIndicator("Economie",
				null)
				//res.getDrawable(R.drawable.ic_tab_economie)
				.setContent(intent);			
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, Sport.class);
		spec = tabHost.newTabSpec("sports").setIndicator("Sports",
				null)
				.setContent(intent);			
		tabHost.addTab(spec);
		
		
		tabHost.setCurrentTab(this.indexTab);
				
	}
}